package com.cn.fangshuo.enums;

import lombok.Getter;

@Getter
public enum LicensePlateColorEnum {
    //目前除了1之外都显示其他
    UNKONWN("unknown", -1, 0, "未知"),
    BLUE("blue", 0, 1, "蓝牌"),
    YELLOW("yellow", 1, 3, "黄牌"),
    GREEN("green", 2, 19, "绿牌"),
    WHITE("white", 3, 8, "白牌"),
    BLACK("black", 4, 10, "黑牌");

    private String name;

    private int code;

    private int shandongCode;

    private String desc;

    LicensePlateColorEnum(String name, int code, int shandongCode, String desc) {
        this.name = name;
        this.code = code;
        this.shandongCode = shandongCode;
        this.desc = desc;
    }

    public static LicensePlateColorEnum getByLicensePlateColor(int code) {
        for (LicensePlateColorEnum licensePlateColorEnum : LicensePlateColorEnum.values()) {
            if (licensePlateColorEnum.getCode() == code) {
                return licensePlateColorEnum;
            }
        }
        return UNKONWN;
    }
}
